<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>trafgen: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">trafgen
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">trafgen Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This file contains the implementation of the AXI Traffic Generator driver.User documentation for the driver functions is contained in this file in the form of comment blocks at the front of each function.</p>
<p>The AXI Traffic Generator IP is designed to generate AXI4 traffic which can be used to stress different modules/interconnect connected in the system. Different configurable options allow the user to generate a wide variety of traffic based on their requirements. The core is broadly separated into a master and slave block, each of which contains the write block and read block. Other support features are provided by the Control registers and Internal RAMs.</p>
<p>The commands to be issued by the AXI traffic generator are loaded in a 128-bit wide, 512 deep command RAM through AXI Slave interface. After the core is enabled, control logic issues the write/read commands based on the command settings programmed. The core updates the Status registers and asserts interrupts on the completion of issuing programmed commands.</p>
<p>The Axi Traffic Genrator has five different modes:</p>
<ul>
<li>Advanced Mode: Advanced Mode allows full control over the traffic genration Control registers are provided to you to program the core to genrate different AXI4 transactions.</li>
<li>Basic Mode: Basic Mode allows basic AXI4 traffic genration with less resource overhead.</li>
<li>Static Mode: Static Mode allows you to genrate a simple AXI4 traffic with very less resource and minimum processor intervention.In this Mode the core continuously genrates fixed address and fixed length INCR type read and write transfers.</li>
<li>System Init Mode: System Init Mode is a special Mode where core provides only AXI4-Lite Master write interface.This mode can be used in a system without a processor to initialize the system peripherals with preconfigured values on system reset.</li>
<li>Streaming Mode: In Streaming Mode the core can be configured to generate traffic based on the register configuration.</li>
</ul>
<p><b>Initialization &amp; Configuration</b></p>
<p>The <a class="el" href="struct_x_traf_gen___config.html" title="The configuration structure for Traffic Generator device. ">XTrafGen_Config</a> structure is used by the driver to configure itself. This configuration structure is typically created by the tool-chain based on HW build properties.</p>
<p>To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in the following way:</p>
<ul>
<li>XTrafGen_LookupConfig(DeviceId) - Use the devide identifier to find the static configuration structure defined in <a class="el" href="xtrafgen__g_8c.html">xtrafgen_g.c</a>. This is setup by the tools. For some operating systems the config structure will be initialized by the software and this call is not needed.</li>
<li>XTrafGen_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a configuration structure provided by the caller. If running in a system with address translation, the provided virtual memory base address replaces the physical address present in the configuration structure.</li>
</ul>
<p><b>Command Handling</b></p>
<p>AXI Traffic Generator core operates based on the commands programmed into Command and Parameter RAMs. The CMDRAM and PARAMRAM is divided into two regions: write and read. Each region can hold 256 entries. Once the core is enabled, the internal control logic issues write/read commands. To handle command programming efficiently, we are maintaining a software list of commands. Following APIs are provided to handle this mechanism:</p>
<ul>
<li><a class="el" href="group__trafgen__v3__2.html#ga39eaea669c1ff2df58e54c002b43f854" title="Add a command to the software list of commands. ">XTrafGen_AddCommand()</a>: This function prepares the Command Words and Parameter Word from the Command structure passed from the user application. It then adds to a software list of commands.</li>
<li><a class="el" href="group__trafgen__v3__2.html#ga14377a8884e99ce01c0c76128c939c49" title="Write Commands to internal Command and Parameter RAMs. ">XTrafGen_WriteCmdsToHw()</a>: This function writes the prepared list of Command and Parameter Words prepared to CMDRAM and PARAMRAM.</li>
<li><a class="el" href="group__trafgen__v3__2.html#ga262d850cbfc5b0495fbc2d84334a1fba" title="Get last Valid Command Index of Write/Read region. ">XTrafGen_GetLastValidIndex()</a>: This function gets last Valid Command Index of Write/Read region. The last valid command index is used to set 'my_depend' and 'other_depend' fields of the Command RAM.</li>
<li><a class="el" href="group__trafgen__v3__2.html#ga539d4976ad3ace9e15d993e2b18143a0" title="Erase all Command Entry values. ">XTrafGen_EraseAllCommands()</a>: This function clears the list of commands maintained in software and also updates the respective RAMs.</li>
<li>XTrafGen_PrintAllCmds(): This function displays the list of commands.</li>
</ul>
<p><b>Master RAM Handling</b></p>
<p>AXI Traffic Generator uses MSTRAM to</p><ul>
<li>Take data from this RAM for write transactions</li>
<li>Store data to this RAM for read transaction User need to call this API to write/read to/from Master RAM,</li>
<li><a class="el" href="group__trafgen__v3__2.html#gaaea625b89454268bbbe7f93e309141c4" title="Write or Read Master RAM. ">XTrafGen_AccessMasterRam()</a> - This function programs the Master RAM with the data which is used in master logic. The amount of the data is limited by the size of master RAM.</li>
</ul>
<p><b>Interrupts</b></p>
<p>The driver defaults to no interrupts at initialization such that interrupts must be enabled if desired. An interrupt is generated for one of the following conditions:</p><ul>
<li>Master Logic Completion Interrupt</li>
<li>Error Interrupt (For Master and Slave Errors)</li>
</ul>
<p>The application can control which interrupts are enabled using these functions:</p><ul>
<li><a class="el" href="group__trafgen__v3__2.html#ga11a588bff0d2c58310d48da4c24126a1" title="XTrafGen_EnableMasterCmpInterrupt enables Master logic complete bit. ">XTrafGen_EnableMasterCmpInterrupt()</a></li>
<li><a class="el" href="group__trafgen__v3__2.html#ga154f34818edeb0858c445690fa4f8670" title="XTrafGen_MasterErrIntrEnable enables Global Master error bit. ">XTrafGen_MasterErrIntrEnable()</a></li>
<li><a class="el" href="group__trafgen__v3__2.html#ga298a1b459b4552cb79b4a2da8d3a1845" title="XTrafGen_SlaveErrIntrEnable enables Global Slave error bit. ">XTrafGen_SlaveErrIntrEnable()</a></li>
</ul>
<p>The interrupt system has to be set up and if the interrupts are enabled, Traffic Generator notifies the software either about the completion or an error in transfer through interrupts.</p>
<p><b> Examples </b></p>
<p>We provided two examples to show how to use the driver API:</p><ul>
<li>One for interrupt mode (xtrafgen_interrupt_example.c)</li>
<li>One for polling mode (xtrafgen_polling_example.c)</li>
</ul>
<p><b> Asserts </b></p>
<p>Asserts are used within all Xilinx drivers to enforce constraints on argument values. Asserts can be turned off on a system-wide basis by defining, at compile time, the NDEBUG identifier. By default, asserts are turned on and it is recommended that users leave asserts on during development.</p>
<p><b>RTOS Independence</b></p>
<p>This driver is intended to be RTOS and processor independent. It works with physical addresses only. Any needs for dynamic memory management, threads or thread mutual exclusion, virtual memory, or cache control must be satisfied by the layer above this driver.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
----- ---- -------- -------------------------------------------------------
1.00a srt  01/24/13 First release
1.01a adk  03/09/13 Updated Driver to Support Streaming and Static Mode
2.00a adk  16/09/13 Fixed CR:737291
2.01a adk  21/10/13 Fixed CR:740522 Updated the MasterRam offset as per latest
	      IP.This driver is valid only for IP(v2.0) onwards. The
	      XTG_MASTER_RAM_OFFSET has been changed from
	      0x10000 to 0xc000.
2.01a adk  15/11/13 Fixed CR:760808 added Macro's for the New bit fields added
		      in the latest tarfgen IP(v2.0).
3.0   adk  12/10/13 Updated as per the New Tcl API's
3.1   adk  28/04/14 Fixed CR:782131 Incorrect mask value for the
	      loopenable bit.
3.2   adk  05/08/14 Fixed CR:798742 The last word of 8KB Master RAM in
	      axi traffic generator can't access and CR:799554
		      Some incorrect parameter in axi traffic generator driver.
4.0   sd  19/08/15 Fixed CR:876564 Added 64-bit Support to axi traffic generator
	     driver.
</pre> </div></div><!-- contents -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
